package mysql

import (
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
	"libraryAutoGrab/model/dto/input"
	"log"
)

type Log struct {
	gorm.Model
	Userinfo input.UserInfo `gorm:"embedded"`
	Area string
	AutoGrab bool
}

func NewMysqlClient() *gorm.DB {
	dsn := "root:gtxyHJH20000118@tcp(121.5.226.151:3306)/library?charset=utf8mb4&parseTime=True"
	db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
	if err != nil {
		log.Println(err)
	}
	return db
}

